/**
 * Created by yang on 15/2/10.
 */
var later = require('later');

var child_process = require('child_process');
var sched = {
    schedules:[
        {h: [18], m: [0,0]}
    ]
};
function autoPull(){
    var child = child_process.spawn('sh',['git_pull.sh']);
    child.stdout.setEncoding('utf8');
    child.stdout.on('data', function(data) {
        console.log(data);
    });
}

later.setInterval(autoPull,sched);

console.log('git pull will be exec at ' + JSON.stringify(sched.schedules));